﻿using System;

namespace ValidationFramework
{
	public abstract class SpecificationBase : ISpecification
	{
		public virtual string DefaultMessage(string targetName, string descriptorType)
		{
			return string.Format("The {0} '{1}' is invalid.", descriptorType, targetName);
		}

		public abstract bool IsSatisfiedBy(object target);

		public virtual bool CanBeSatisfiedBy(Type type)
		{
			return true;
		}

		public virtual bool IsEquivalentTo(ISpecification spec)
		{
			return false;
		}
	}
}
